import Vue from 'vue'
import Router from 'vue-router'
import AdminLogin from '../components/system/AdminLogin.vue'
import AdminAccount from '../components/system/AdminAccount.vue'
import AdminRole from '../components/system/AdminRole.vue'
import AddShop from '../components/system/AddShop.vue'
import FindShop from '../components/system/FindShop.vue'
import AddWh from '../components/system/AddWh.vue'
import FindWh from '../components/system/FindWh.vue'
import AdminInfo from '../components/system/AdminInfo.vue'
import FindAdminInfo from '../components/system/FindAdminInfo.vue'
import UpdateAdminPass from '../components/system/UpdateAdminPass.vue'
import AddScoreRuler from '../components/system/AddScoreRuler.vue'
import FindScore from '../components/system/FindScore.vue'
import Main from '../components/system/Main.vue'
import AddGoods from '../components/store/AddGoods.vue'
import Goods from '../components/store/Goods.vue'
import ModifyGoods from '../components/store/ModifyGoods.vue'
import SurveyGoods from '../components/store/SurveyGoods.vue'
import ValueGoods from '../components/store/ValueGoods.vue'
import AuditingGoods from '../components/store/AuditingGoods.vue'
import ValueRecordVew from '../components/store/ValueRecordVew.vue'
import SurveyRecordVew from '../components/store/SurveyRecordVew.vue'
import Brand from '../components/store/Brand.vue'
import AdminLoginInfo from '../components/system/AdminLoginInfo.vue'
import UserLoginInfo from '../components/system/UserLoginInfo.vue'
import AttrGroupVew from '../components/store/AttrGroupVew.vue'
import AttrInfoVew from '../components/store/AttrInfoVew.vue'
import PrimaryClass from '../components/store/PrimaryClass.vue'
import UserAccount from '../components/system/UserAccount.vue'
import NoPermission from '../components/system/NoPermission.vue'
import DealGoods from '../components/store/DealGoods.vue'
import ShowGoods from '../components/store/ShowGoods.vue'
Vue.use(Router)

const VueRouterPush = Router.prototype.push
Router.prototype.push=function push (to){
  return VueRouterPush.call(this,to).catch(err=>err)
}

export default new Router({
  routes: [

    {
      path:"/",
      redirect:"/adminLogin"
    },
    {
      path:"/adminLogin",
      component:AdminLogin
    },
    {
      path:"/noPermission",
      component:NoPermission
    },
    {
      path:"/main",
      component:Main,
      children:[
        {
          path:"/adminAccount",
          component:AdminAccount
        },
        {
          path:"/dminRole",
          component:AdminRole
        },
        {
          path:"/adminLoginInfo",
          component:AdminLoginInfo
        },
        {
          path:"/userLoginInfo",
          component:UserLoginInfo
        },
        {
          path:"/addShop",
          component:AddShop
        },
        {
          path:"/findShop",
          component:FindShop
        },
        {
          path:"/addWh",
          component:AddWh
        },
        {
          path:"/findWh",
          component:FindWh
        },
        {
          path:"/addGoods",
          component:AddGoods
        },
        {
          path:"/modifyGoods",
          name:'ModifyGoods',
          component:ModifyGoods
        },
        {
          path:"/surveyGoods",
          name:'SurveyGoods',
          component:SurveyGoods
        },
        {
          path:"/valueGoods",
          name:'ValueGoods',
          component:ValueGoods
        },
        {
          path:"/auditingGoods",
          name:'AuditingGoods',
          component:AuditingGoods
        },
        {
          path:"/surveyRecordVew",
          name:'SurveyRecordVew',
          component:SurveyRecordVew
        },
        {
          path:"/valueRecordVew",
          name:'ValueRecordVew',
          component:ValueRecordVew
        },
        {
          path:"/attrGroupVew",
          name:'AttrGroupVew',
          component:AttrGroupVew
        },
        {
          path:"/attrInfoVew",
          name:'AttrInfoVew',
          component:AttrInfoVew
        },
        {
          path:"/dealGoods",
          name:'DealGoods',
          component:DealGoods
        },
        {
          path:"/showGoods",
          name:'ShowGoods',
          component:ShowGoods
        },
        {
          path:"/goods",
          component:Goods
        },
        {
          path:"/adminInfo",
          component:AdminInfo,
          children:[
            {
              path:"/findAdminInfo",
              component:FindAdminInfo
            },
            {
              path:"/updateAdminPass",
              component:UpdateAdminPass
            },
          ],
        },
        {
          path:"/addScoreRuler",
          component:AddScoreRuler
        },
        {
          path:"/brand",
          component:Brand
        },
        {
          path:"/findScore",
          component:FindScore
        },
        {
          path:"/primaryClass",
          component:PrimaryClass
        },
        {
          path:"/userAccount",
          component:UserAccount
        },
      ]
    }
]
})
